﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace GtsServer.Common
{
    public class Configuration
    {
        /// <summary>
        /// 网站地址的绝对路径
        /// </summary>
        /// <returns></returns>
        public static string WebSiteFolder()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["WebSiteFolder"] != null ? System.Configuration.ConfigurationSettings.AppSettings["WebSiteFolder"].ToString() : "";
        }

        /// <summary>
        /// 授权中心
        /// </summary>
        /// <returns></returns>
        public static string passportUrl()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["passportUrl"] != null ? System.Configuration.ConfigurationSettings.AppSettings["passportUrl"].ToString() : "";
        }
        
        /// <summary>
        /// 授权中心 New
        /// </summary>
        /// <returns></returns>
        public static string passportUrlNew()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["passportUrlNew"] != null ? System.Configuration.ConfigurationSettings.AppSettings["passportUrlNew"].ToString() : "";
        }

        /// <summary>
        /// 注册licesen
        /// </summary>
        /// <returns></returns>
        public static string licesenUrl()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["licesenUrl"] != null ? System.Configuration.ConfigurationSettings.AppSettings["licesenUrl"].ToString() : "";
        }

        /// <summary>
        /// 绑定节点
        /// </summary>
        /// <returns></returns>
        public static string nodeUrl()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["nodeUrl"] != null ? System.Configuration.ConfigurationSettings.AppSettings["nodeUrl"].ToString() : "";
        }


        /// <summary>
        /// 绑定节点回调地址
        /// </summary>
        /// <returns></returns>
        public static string callBackUrl()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["callBackUrl"] != null ? System.Configuration.ConfigurationSettings.AppSettings["callBackUrl"].ToString() : "";
        }
        /// <summary>
        /// 修改订单回调地址
        /// </summary>
        /// <returns></returns>
        public static string CallBackUpdateOrderUrl()
        {
            return ConfigurationManager.AppSettings["CallBackUpdateOrder"] != null ? ConfigurationManager.AppSettings["CallBackUpdateOrder"].ToString() : "";
        }
        /// <summary>
        /// 添加订单回调地址
        /// </summary>
        /// <returns></returns>
        public static string CallBackAddOrderUrl()
        {
            return ConfigurationManager.AppSettings["CallBackAddOrder"] != null ? ConfigurationManager.AppSettings["CallBackAddOrder"].ToString() : "";
        }


        /// <summary>
        /// 矩阵url通信地址
        /// </summary>
        /// <returns></returns>
        public static string apiUrl()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["apiUrl"] != null ? System.Configuration.ConfigurationSettings.AppSettings["apiUrl"].ToString() : "";
        }

        /// <summary>
        /// mobileServerUrl通信地址
        /// </summary>
        /// <returns></returns>
        public static string mobileServerUrl()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["mobileServerUrl"] != null ? System.Configuration.ConfigurationSettings.AppSettings["mobileServerUrl"].ToString() : "";
        }


        /// <summary>
        /// 矩阵地址
        /// </summary>
        /// <returns></returns>
        public static string MatrixUrl()
        {
            return ConfigurationManager.AppSettings["matrixUrl"] != null ? ConfigurationManager.AppSettings["matrixUrl"].ToString() : "";
        }

        /// <summary>
        /// 连接字符串
        /// </summary>
        /// <param name="ContrName"></param>
        /// <returns></returns>
        public static string GetConnectionStr()
        {
            return ConfigurationManager.ConnectionStrings["MobileShopEntitieLogWrite"].ConnectionString;
        }
        /// <summary>
        /// 程序域名
        /// </summary>
        /// <returns></returns>
        public static string GetDomainName()
        {
            return ConfigurationManager.AppSettings["DomainName"].ToString();
        }
        /// <summary>
        /// 打包后的保存路径
        /// </summary>
        /// <returns></returns>
        public static string GetPackagePath()
        {
            return ConfigurationManager.AppSettings["PackagePath"].ToString();
        }
        public static string GetAppKeyTargetUrl()
        {
            return ConfigurationManager.AppSettings["AppKeyTargetUrl"].ToString();
        }
        public static string GetResUrl()
        {
            return ConfigurationManager.AppSettings["ResUrl"].ToString();
        }

        public static string GetShopType()
        {
            return ConfigurationManager.AppSettings["ShopType"].ToString();
        }

        public static string GetWebUrl()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["WebUrl"] != null ? System.Configuration.ConfigurationSettings.AppSettings["WebUrl"].ToString() : "";
        }

        public static string GetAppKey()
        {
            return System.Configuration.ConfigurationSettings.AppSettings["app_key"] != null ? System.Configuration.ConfigurationSettings.AppSettings["app_key"].ToString() : "";
        }
    }
}
